package com.tom.spring.demo.controller;

import com.tom.spring.demo.service.ManagerService;
import com.tom.spring.demo.service.UserService;
import com.tom.spring.formework.annotation.Autowired;
import com.tom.spring.formework.annotation.Controller;
import com.tom.spring.formework.annotation.RequestMapping;
import com.tom.spring.formework.annotation.RequestParam;
import com.tom.spring.formework.webmvc.ModelAndView;

import java.util.HashMap;
import java.util.Map;

/**
 * 公布接口url
 * @author Tom
 *
 */
@Controller
@RequestMapping("/")
public class PageController {

	@Autowired
	UserService userService;

	@Autowired(value = "manager_service_tom")
	ManagerService managerService;
	
	@RequestMapping("/first.html")
	public ModelAndView query(@RequestParam("name") String name){
		String result = userService.query(name);
		Map<String,Object> model = new HashMap<String,Object>();
		model.put("teacher", name);
		model.put("data", result);
		model.put("token", "123456");
		return new ModelAndView("test.html",model);
	}
	
}
